home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / Apple II / Essentials / APW Interfaces / CInclude / Window.h < prev   
Encoding:
C/C++ Source or Header  |  1992-02-26  |  16.8 KB  |  437 lines  |  [TEXT/MPS ]

  1. /********************************************
  2. ; File: Window.h
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc. 1986-92
  6. ; All Rights Reserved
  7. ;
  8. ********************************************/
  9. #ifndef __TYPES__
  10. #include <TYPES.h>
  11. #endif
  12.  
  13. #ifndef __QUICKDRAW__
  14. #include <QUICKDRAW.h>
  15. #endif
  16.  
  17. #ifndef __EVENT__
  18. #include <EVENT.h>
  19. #endif
  20.  
  21. #ifndef __CONTROL__
  22. #include <CONTROL.h>
  23. #endif
  24.  
  25. #ifndef __WINDOW__
  26. #define __WINDOW__
  27.  
  28.  
  29. /* Error Codes */
  30. #define paramLenErr 0x0E01    /* first word of parameter list is the wrong size */
  31. #define allocateErr 0x0E02    /* unable to allocate window record */
  32. #define taskMaskErr 0x0E03    /* reserved bits are not clear in wmTaskMask */
  33.  
  34. /* Axis Parameters */
  35. #define wNoConstraint 0x0000    /* No constraint on movement. */
  36. #define wHAxisOnly 0x0001        /* Horizontal axis only. */
  37. #define wVAxisOnly 0x0002        /* Vertical axis only. */
  38.  
  39. /* Desktop Command Codes */
  40. #define FromDesk 0x00            /* Subtract region from desktop */
  41. #define ToDesk 0x1                /* Add region to desktop */
  42. #define GetDesktop 0x2            /* Get Handle of Desktop region */
  43. #define SetDesktop 0x3            /* Set Handle of Desktop region */
  44. #define GetDeskPat 0x4            /* Address of pattern or drawing routine */
  45. #define SetDeskPat 0x5            /* Change Address of pattern or drawing routine */
  46. #define GetVisDesktop 0x6        /* Get destop region less visible windows. */
  47. #define BackGroundRgn 0x7        /* For drawing directly on desktop. */
  48. #define CheckForNewDeskMsg 0x8    /* Force rechecking message #2 */
  49.  
  50. /* SendBehind Values */
  51. #define toBottom 0xFFFFFFFEL    /* To send window to bottom. */
  52. #define topMost 0xFFFFFFFFL        /* To make window top. */
  53. #define bottomMost 0x0000L        /* To make window bottom. */
  54.  
  55. /* Task Masks */
  56. #define tmMenuKey 0x00000001L
  57. #define tmUpdate 0x00000002L
  58. #define tmFindW 0x00000004L
  59. #define tmMenuSel 0x0008L
  60. #define tmOpenNDA 0x0010L
  61. #define tmSysClick 0x0020L
  62. #define tmDragW 0x0040L
  63. #define tmContent 0x0080L
  64. #define tmClose 0x0100L
  65. #define tmZoom 0x0200L
  66. #define tmGrow 0x0400L
  67. #define tmScroll 0x0800L
  68. #define tmSpecial 0x1000L
  69. #define tmCRedraw 0x2000L
  70. #define tmInactive 0x4000L
  71. #define tmInfo 0x8000L
  72. #define tmContentControls 0x00010000L
  73. #define tmControlKey 0x00020000L
  74. #define tmControlMenu 0x00040000L
  75. #define tmMultiClick 0x00080000L
  76. #define tmIdleEvents 0x00100000L
  77.  
  78. /* TaskMaster Codes */
  79. #define wNoHit 0x0000        /* retained for back compatibility. */
  80. #define inNull 0x0000        /* retained for back compatibility */
  81. #define inKey 0x0003        /* retained for back compatibility */
  82. #define inButtDwn 0x0001    /* retained for back compatibility */
  83. #define inUpdate 0x0006        /* retained for back compatibility */
  84. #define wInDesk 0x0010        /* On Desktop */
  85. #define wInMenuBar 0x0011    /* On system menu bar */
  86. #define wClickCalled 0x0012    /* system click called */
  87. #define wInContent 0x0013    /* In content region */
  88. #define wInDrag 0x0014        /* In drag region */
  89. #define wInGrow 0x0015        /* In grow region, active window only */
  90. #define wInGoAway 0x0016    /* In go-away region, active window only */
  91. #define wInZoom 0x0017        /* In zoom region, active window only */
  92. #define wInInfo 0x0018        /* In information bar */
  93. #define wInSpecial 0x0019    /* Item ID selected was 250 - 255 */
  94. #define wInDeskItem 0x001A    /* Item ID selected was 1 - 249 */
  95. #define wInFrame 0x1B        /* in Frame, but not on anything else */
  96. #define wInactMenu 0x1C        /* 'selection' of inactive menu item */
  97. #define wClosedNDA 0x001D    /* desk accessory closed */
  98. #define wCalledSysEdit 0x001E    /* inactive menu item selected */
  99. #define wInSysWindow 0x8000    /* hi bit set for system windows */
  100.  
  101. /* VarCode */
  102. #define wDraw 0x00        /* Draw window frame command. */
  103. #define wHit 0x01        /* Hit test command. */
  104. #define wCalcRgns 0x02    /* Compute regions command. */
  105. #define wNew 0x03        /* Initialization command. */
  106. #define wDispose 0x04    /* Dispose command. */
  107. #define wGetDrag 5        /* Return address of outline drawing handler */
  108. #define wGrowFrame 6    /* Draw outline of window being resized */
  109. #define wRecSize 7        /* Return size of additional space neeed in the windrec */
  110. #define wPos 8            /* Return RECT that is the window's portRect */
  111. #define wBehind 9        /* Return where the window should be placed in the list */
  112. #define wCallDefProc 10    /* Generic call to the defproc */
  113.  
  114. /* WFrame */
  115. #define fHilited 0x0001    /* Window is highlighted. */
  116. #define fZoomed 0x0002    /* Window is zoomed. */
  117. #define fAllocated 0x0004    /* Window record was allocated. */
  118. #define fCtlTie 0x0008    /* Window state tied to controls. */
  119. #define fInfo 0x0010    /* Window has an information bar. */
  120. #define fVis 0x0020        /* Window is visible. */
  121. #define fQContent 0x0040
  122. #define fMove 0x0080    /* Window is movable. */
  123. #define fZoom 0x0100    /* Window is zoomable. */
  124. #define fFlex 0x0200
  125. #define fGrow 0x0400    /* Window has grow box. */
  126. #define fBScroll 0x0800    /* Window has horizontal scroll bar. */
  127. #define fRScroll 0x1000    /* Window has vertical scroll bar. */
  128. #define fAlert 0x2000
  129. #define fClose 0x4000    /* Window has a close box. */
  130. #define fTitle 0x8000    /* Window has a title bar. */
  131.  
  132. /* DoModalWindow flag values */
  133. #define mwMovable 0x8000
  134. #define mwUpdateAll 0x4000
  135. #define mwDeskAcc 0x0010
  136. #define mwIBeam 0x0008
  137. #define mwMenuKey 0x0004
  138. #define mwMenuSelect 0x0002
  139. #define mwNoScrapForLE 0x0001
  140.  
  141. /* HandleDiskInsert flag values (bit flags) */
  142. #define hdiScan 0x8000
  143. #define hdiHandle 0x4000
  144. #define hdiUpdate 0x2000
  145. #define hdiReportEjects 0x1000
  146. #define hdiNoDelay 0x0800
  147. #define hdiDupDisk 0x0400
  148. #define hdiCheckTapeDrives 0x0200
  149. #define hdiUnreadable 0x0100
  150. #define hdiMarkOffline 0x0001
  151.  
  152. /* HandleDiskInsert result flag values (bit flags) */
  153. #define hdiFormatted 0x0002
  154. #define hdiEjection 0x0001
  155.  
  156. /* constants for AlertWindow alertFlags */
  157. #define awCString 0x0000
  158. #define awPString 0x0001
  159. #define awPointer 0x0000
  160. #define awHandle 0x0002
  161. #define awResource 0x0004
  162. #define awTextFullWidth 0x0008
  163. #define awForceBeep 0x0010
  164. #define awButtonLayout 0x0020
  165. #define awNoDevScan 0x0040
  166. #define awNoDisposeRes 0x0080
  167. #define awWatchForDisk 0x0100
  168. #define awIconIsResource 0x0200
  169. #define awFullColor 0x0400
  170.  
  171. /* Other Constants */
  172. #define windSize 0x00D4            /* Size of WindRec. */
  173. #define wmTaskRecSize 0x002E    /* Size of WmTaskRec. */
  174. #define wTrackZoom 0x001F
  175. #define wHitFrame 0x0020
  176. #define wInControl 0x0021
  177. #define wInControlMenu 0x0022
  178.  
  179. /* custom defproc dRequest codes (from TN #42) */
  180. #define wSetOrgMask            0
  181. #define wSetMaxGrow            1
  182. #define wSetScroll            2
  183. #define wSetPage            3
  184. #define wSetInfoRefCon        4
  185. #define wSetInfoDraw        5
  186. #define wSetOrigin            6
  187. #define wSetDataSize        7
  188. #define wSetZoomRect        8
  189. #define wSetTitle            9
  190. #define wSetColorTable        10
  191. #define wSetFrameFlag        11
  192. #define wGetOrgMask            12
  193. #define wGetMaxGrow            13
  194. #define wGetScroll            14
  195. #define wGetPage            15
  196. #define wGetInfoRefCon        16
  197. #define wGetInfoDraw        17
  198. #define wGetOrigin            18
  199. #define wGetDataSize        19
  200. #define wGetZoomRect        20
  201. #define wGetTitle            21
  202. #define wGetColorTable        22
  203. #define wGetFrameFlag        23
  204. #define wGetInfoRect        24
  205. #define wGetDrawInfo        25
  206. #define wGetStartInfoDraw    26
  207. #define wGetEndInfoDraw        27
  208. #define wZoomWindow            28
  209. #define wStartDrawing        29
  210. #define wStartMove            30
  211. #define wStartGrow            31
  212. #define wNewSize            32
  213. #define wTask                33
  214.  
  215. typedef EventRecord WmTaskRec;
  216. typedef EventRecordPtr WmTaskRecPtr;
  217.  
  218. typedef struct WindColor {
  219.     Word frameColor;     /* Color of window frame. */
  220.     Word titleColor;     /* Color of title and bar. */
  221.     Word tBarColor;     /* Color/pattern of title bar. */
  222.     Word growColor;     /* Color of grow box. */
  223.     Word infoColor;     /* Color of information bar. */
  224. } WindColor, *WindColorPtr, **WindColorHndl;
  225.  
  226. typedef struct WindRec {
  227.     /* struct WindRec *wNext; not included in record returned by ToolBox calls */
  228.     GrafPort port;            /* Window's port */
  229.     ProcPtr wDefProc;
  230.     LongWord wRefCon;
  231.     ProcPtr wContDraw;
  232.     LongWord wReserved;        /* Space for future expansion */
  233.     RegionHndl wStrucRgn;    /* Region of frame plus content. */
  234.     RegionHndl wContRgn;    /* Content region. */
  235.     RegionHndl wUpdateRgn;    /* Update region. */
  236.     CtlRecHndl wControls;    /* Window's control list. */
  237.     CtlRecHndl wFrameCtrls;    /* Window frame's control list. */
  238.     Word wFrame;
  239. } WindRec, *WindRecPtr;
  240.  
  241. typedef struct ParamList {
  242.     Word paramLength;        /* Parameter to NewWindow.  */
  243.     Word wFrameBits;        /* Parameter to NewWindow. */
  244.     Pointer wTitle;            /* Parameter to NewWindow. */
  245.     LongWord wRefCon;        /* Parameter to NewWindow. */
  246.     Rect wZoom;                /* Parameter to NewWindow. */
  247.     WindColorPtr wColor;    /* Parameter to NewWindow. */
  248.     Word wYOrigin;            /* Parameter to NewWindow. */
  249.     Word wXOrigin;            /* Parameter to NewWindow. */
  250.     Word wDataH;            /* Parameter to NewWindow. */
  251.     Word wDataW;            /* Parameter to NewWindow. */
  252.     Word wMaxH;                /* Parameter to NewWindow. */
  253.     Word wMaxW;                /* Parameter to NewWindow. */
  254.     Word wScrollVer;        /* Parameter to NewWindow. */
  255.     Word wScrollHor;        /* Parameter to NewWindow. */
  256.     Word wPageVer;            /* Parameter to NewWindow. */
  257.     Word wPageHor;            /* Parameter to NewWindow. */
  258.     LongWord wInfoRefCon;    /* Parameter to NewWindow. */
  259.     Word wInfoHeight;        /* height of information bar */
  260.     LongProcPtr wFrameDefProc;    /* Parameter to NewWindow. */
  261.     VoidProcPtr wInfoDefProc;    /* Parameter to NewWindow. */
  262.     VoidProcPtr wContDefProc;    /* Parameter to NewWindow. */
  263.     Rect wPosition;            /* Parameter to NewWindow. */
  264.     WindowPtr wPlane;        /* Parameter to NewWindow. */
  265.     WindRecPtr wStorage;    /* Parameter to NewWindow. */
  266. } ParamList, *ParamListPtr, **ParamListHndl;
  267.  
  268. typedef struct WindParam1 {
  269.     Word            p1Length;
  270.     Word            p1Frame;
  271.     Pointer            p1Title;
  272.     LongWord        p1RefCon;
  273.     Rect            p1ZoomRect;
  274.     WindColorPtr    p1ColorTable;
  275.     Word            p1YOrigin;
  276.     Word            p1XOrigin;
  277.     Word            p1DataHeight;
  278.     Word            p1DataWidth;
  279.     Word            p1MaxHeight;
  280.     Word            p1MaxWidth;
  281.     Word            p1VerScroll;
  282.     Word            p1HorScroll;
  283.     Word            p1VerPage;
  284.     Word            p1HorPage;
  285.     LongWord        p1InfoText;
  286.     Word            p1InfoHeight;
  287.     LongProcPtr        p1DefProc;
  288.     VoidProcPtr        p1InfoDraw;
  289.     VoidProcPtr        p1ContentDraw;
  290.     Rect            p1Position;
  291.     WindowPtr        p1Plane;
  292.     Long            p1ControlList;
  293.     Word            p1InDesc;
  294. } WindParam1, *WindParam1Ptr, **WindParam1Hndl;
  295.  
  296. typedef struct DeskMessageRecord {
  297.     LongWord reserved;
  298.     Word messageType;
  299.     Word drawType;
  300. } DeskMessageRecord, *DeskMessageRecordPtr;
  301.  
  302. typedef struct AuxWindInfoRecord {
  303.     Word recordSize;
  304.     Word reservedForBank;
  305.     Word reservedForDP;
  306.     Word reservedForResApp;
  307.     LongWord reservedForUpdateHandle;
  308.     LongWord reservedForEndUpdatePort;
  309.     LongWord reservedForWindoidLayer;
  310.     Word sysWindMinHeight;
  311.     Word sysWindMinWidth;
  312.     Ptr NDASysWindPtr;
  313. } AuxWindInfoRecord, *AuxWindInfoPtr;
  314.  
  315. typedef struct WindGlobalsRec {
  316.     Word        lineW;
  317.     Word        titleHeight;
  318.     Word        titleYPos;
  319.     Word        closeHeight;
  320.     Word        closeWidth;
  321.     LongWord    defWindClr;
  322.     LongWord    windIconFont;
  323.     Word        screenMode;
  324.     Byte        pattern[32];
  325.     Word        callerDPage;
  326.     Word        callerDataB;
  327. } WindGlobalsRec, *WindGlobalsRecPtr, **WindGlobalsRecHndl;
  328.  
  329. extern pascal Word AlertWindow() inline(0x590E,dispatcher);
  330. extern pascal void BeginUpdate() inline(0x1E0E,dispatcher);
  331. extern pascal void BringToFront() inline(0x240E,dispatcher);
  332. extern pascal Boolean CheckUpdate() inline(0x0A0E,dispatcher);
  333. extern pascal void CloseWindow() inline(0x0B0E,dispatcher);
  334. extern pascal Handle CompileText() inline(0x600E,dispatcher);
  335. extern pascal Pointer Desktop() inline(0x0C0E,dispatcher);
  336. extern pascal void DragWindow() inline(0x1A0E,dispatcher);
  337. extern pascal void DrawInfoBar() inline(0x550E,dispatcher);
  338. extern pascal void EndFrameDrawing() inline(0x5B0E,dispatcher);
  339. extern pascal void EndInfoDrawing() inline(0x510E,dispatcher);
  340. extern pascal void EndUpdate() inline(0x1F0E,dispatcher);
  341. extern pascal Word ErrorWindow() inline(0x620E,dispatcher);
  342. extern pascal Word FindWindow() inline(0x170E,dispatcher);
  343. extern pascal WindowPtr FrontWindow() inline(0x150E,dispatcher);
  344. extern pascal void GDRPrivate() inline(0x540E,dispatcher);
  345. extern pascal VoidProcPtr GetContentDraw() inline(0x480E,dispatcher);
  346. extern pascal Long GetContentOrigin () inline(0x3E0E,dispatcher);
  347. extern pascal RegionHndl GetContentRgn() inline(0x2F0E,dispatcher);
  348. extern pascal LongWord GetDataSize() inline(0x400E,dispatcher);
  349. extern pascal LongProcPtr GetDefProc() inline(0x310E,dispatcher);
  350. extern pascal WindowPtr GetFirstWindow() inline(0x520E,dispatcher);
  351. extern pascal void GetFrameColor() inline(0x100E,dispatcher);
  352. extern pascal VoidProcPtr GetInfoDraw() inline(0x4A0E,dispatcher);
  353. extern pascal LongWord GetInfoRefCon() inline(0x350E,dispatcher);
  354. extern pascal LongWord GetMaxGrow() inline(0x420E,dispatcher);
  355. extern pascal WindowPtr GetNextWindow() inline(0x2A0E,dispatcher);
  356. extern pascal LongWord GetPage() inline(0x460E,dispatcher);
  357. extern pascal void GetRectInfo() inline(0x4F0E,dispatcher);
  358. extern pascal LongWord GetScroll() inline(0x440E,dispatcher);
  359. extern pascal RegionHndl GetStructRgn() inline(0x2E0E,dispatcher);
  360. extern pascal Boolean GetSysWFlag() inline(0x4C0E,dispatcher);
  361. extern pascal RegionHndl GetUpdateRgn() inline(0x300E,dispatcher);
  362. extern pascal CtlRecHndl GetWControls() inline(0x330E,dispatcher);
  363. extern pascal Word GetWFrame() inline(0x2C0E,dispatcher);
  364. extern pascal Word GetWKind() inline(0x2B0E,dispatcher);
  365. extern pascal WindowPtr GetWMgrPort() inline(0x200E,dispatcher);
  366. extern pascal LongWord GetWRefCon() inline(0x290E,dispatcher);
  367. extern pascal Pointer GetWTitle() inline(0x0E0E,dispatcher);
  368. extern pascal Ptr GetWindowMgrGlobals() inline(0x580E,dispatcher);
  369. extern pascal Rect *GetZoomRect() inline(0x370E,dispatcher);
  370. extern pascal LongWord GrowWindow() inline(0x1B0E,dispatcher);
  371. extern pascal void HideWindow() inline(0x120E,dispatcher);
  372. extern pascal void HiliteWindow() inline(0x220E,dispatcher);
  373. extern pascal void InvalRect() inline(0x3A0E,dispatcher);
  374. extern pascal void InvalRgn() inline(0x3B0E,dispatcher);
  375. extern pascal void MoveWindow() inline(0x190E,dispatcher);
  376. extern pascal WindowPtr NewWindow() inline(0x090E,dispatcher);
  377. extern pascal WindowPtr NewWindow2() inline(0x610E,dispatcher);
  378. extern pascal Point PinRect() inline(0x210E,dispatcher);
  379. extern pascal void RefreshDesktop() inline(0x390E,dispatcher);
  380. extern pascal void ResizeWindow() inline(0x5C0E,dispatcher);
  381. extern pascal void SelectWindow() inline(0x110E,dispatcher);
  382. extern pascal void SendBehind() inline(0x140E,dispatcher);
  383. extern pascal void SetContentDraw() inline(0x490E,dispatcher);
  384. extern pascal void SetContentOrigin() inline(0x3F0E,dispatcher);
  385. extern pascal void SetContentOrigin2() inline(0x570E,dispatcher);
  386. extern pascal void SetDataSize() inline(0x410E,dispatcher);
  387. extern pascal void SetDefProc() inline(0x320E,dispatcher);
  388. extern pascal void SetFrameColor() inline(0x0F0E,dispatcher);
  389. extern pascal void SetInfoDraw() inline(0x160E,dispatcher);
  390. extern pascal void SetInfoRefCon() inline(0x360E,dispatcher);
  391. extern pascal void SetMaxGrow() inline(0x430E,dispatcher);
  392. extern pascal void SetOriginMask() inline(0x340E,dispatcher);
  393. extern pascal void SetPage() inline(0x470E,dispatcher);
  394. extern pascal void SetScroll() inline(0x450E,dispatcher);
  395. extern pascal void SetSysWindow() inline(0x4B0E,dispatcher);
  396. extern pascal void SetWFrame() inline(0x2D0E,dispatcher);
  397. extern pascal void SetWRefCon() inline(0x280E,dispatcher);
  398. extern pascal void SetWTitle() inline(0x0D0E,dispatcher);
  399. extern pascal FontHndl SetWindowIcons() inline(0x4E0E,dispatcher);
  400. extern pascal void SetZoomRect() inline(0x380E,dispatcher);
  401. extern pascal void ShowHide() inline(0x230E,dispatcher);
  402. extern pascal void ShowWindow() inline(0x130E,dispatcher);
  403. extern pascal void SizeWindow() inline(0x1C0E,dispatcher);
  404. extern pascal void StartDrawing() inline(0x4D0E,dispatcher);
  405. extern pascal void StartFrameDrawing() inline(0x5A0E,dispatcher);
  406. extern pascal void StartInfoDrawing() inline(0x500E,dispatcher);
  407. extern pascal Word TaskMaster() inline(0x1D0E,dispatcher);
  408. extern pascal void TaskMasterContent() inline(0x5D0E,dispatcher);
  409. extern pascal Word TaskMasterDA() inline(0x5F0E,dispatcher);
  410. extern pascal void TaskMasterKey() inline(0x5E0E,dispatcher);
  411. extern pascal Boolean TrackGoAway() inline(0x180E,dispatcher);
  412. extern pascal Boolean TrackZoom() inline(0x260E,dispatcher);
  413. extern pascal void ValidRect() inline(0x3C0E,dispatcher);
  414. extern pascal void ValidRgn() inline(0x3D0E,dispatcher);
  415. extern pascal void WindBootInit() inline(0x010E,dispatcher);
  416. extern pascal LongWord WindDragRect() inline(0x530E,dispatcher);
  417. extern pascal void WindNewRes() inline(0x250E,dispatcher);
  418. extern pascal void WindReset() inline(0x050E,dispatcher);
  419. extern pascal void WindShutDown() inline(0x030E,dispatcher);
  420. extern pascal void WindStartUp() inline(0x020E,dispatcher);
  421. extern pascal Boolean WindStatus() inline(0x060E,dispatcher);
  422. extern pascal Word WindVersion() inline(0x040E,dispatcher);
  423. extern pascal Word WindowGlobal() inline(0x560E,dispatcher);
  424. extern pascal void ZoomWindow() inline(0x270E,dispatcher);
  425.  
  426. extern pascal AuxWindInfoPtr GetAuxWindInfo() inline(0x630E,dispatcher);
  427. extern pascal LongWord DoModalWindow() inline(0x640E,dispatcher);
  428. extern pascal Word MWGetCtlPart() inline(0x650E,dispatcher);
  429. extern pascal VoidProcPtr SetMenuProc() inline(0x660E,dispatcher);
  430. extern pascal void MWStdDrawProc() inline(0x670E,dispatcher);
  431. extern pascal void MWSetUpEditMenu() inline(0x680E,dispatcher);
  432. extern pascal Word FindCursorCtl() inline(0x690E,dispatcher);
  433. extern pascal void ResizeInfoBar() inline(0x6A0E,dispatcher);
  434. extern pascal LongWord HandleDiskInsert() inline(0x6B0E,dispatcher);
  435.  
  436. #endif
  437.